package org.dromara.system.controller.xiaofu;


import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.system.domain.query.XfCompanyQuery;
import org.dromara.system.domain.vo.XfCompanyVo;
import org.dromara.system.service.IXfCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/xiaofu/company")
public class XfCompanyController extends BaseController {

    @Autowired
    private IXfCompanyService xfCompanyService;

    @GetMapping("/list")
    public TableDataInfo<XfCompanyVo> list(XfCompanyQuery query){
        return xfCompanyService.selectPageXfCompanyList(query);
    }

    @GetMapping("/{companyId}")
    public R<XfCompanyVo> getDetail(@PathVariable Long companyId){
        XfCompanyVo xfCompanyVo = xfCompanyService.selectXfCompanyById(companyId);
        return R.ok(xfCompanyVo);
    }

}